package com.example.workspace.DIdemo;

public class Book {

    private String bname;

    //set方法注入
    public void setBname(String bname) {
        this.bname = bname;
    }

    public Book(){}
    //有参数构造注入
    public Book(String bname) {
        this.bname = bname;
    }



    public void testDemo() {
        System.out.println(bname);
    }
}
